package luogu;

import java.util.Scanner;

public class P1765 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        String[] arr = {"abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
        int res = 0;
        for (int i = 0; i < s.length(); i++) {
            for (int j = 0; j < arr.length; j++) {
                if (s.charAt(i) == ' '){
                    res++;
                    break;
                }else if(arr[j].contains((s.charAt(i)) + "")){
                    res += arr[j].indexOf(s.charAt(i)) + 1;
                    break;
                }
            }
        }
        System.out.println(res);
    }
}
